/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sys;

/**
 *
 * @author Jonas
 */
public class GUIUpdaterThread extends Thread {

    private GUIUpdaterInterface objectToUpdate;
    private boolean run;

    public GUIUpdaterThread(GUIUpdaterInterface objectToUpdate) {
        this.objectToUpdate = objectToUpdate;
        this.run = true;
    }

    @Override
    public void run() {
        super.run();
        if(run) {
            this.objectToUpdate.updateGui();
        }
    }

    public void setRun(boolean run) {
        this.run = run;
    }

}
